package com.example.androiddev;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import com.example.androiddev.activity.ArrayUtilsActivity;
import com.example.androiddev.activity.QuickAdapterActivity;
import com.example.androiddev.base.BaseActivity;
import com.example.commonlib.listener.NoDoubleClickListener;
import com.wanjian.sak.SAK;
import com.wanjian.sak.config.Config;

/**
 * Created by zxw.
 * CreateDate: 2019/12/18 16:36
 * Description: 主界面
 */
public class MainActivity extends BaseActivity {
    /**
     * context  上下文
     */
    private Context context;

    private final static String TAG = "MainActivity";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        context = MainActivity.this;
        Config config = new Config.Build(this).build();
        SAK.init(getApplication(), config);

    }

    @Override
    protected void initView() {
        super.initView();
        setTitle(TAG);
        findViewById(R.id.quick_adapter).setOnClickListener(new NoDoubleClickListener() {
            @Override
            public void onNoDoubleClick(View v) {
                Intent intent = new Intent(context, QuickAdapterActivity.class);
                startActivity(intent);
            }
        });

        findViewById(R.id.array_utils).setOnClickListener(new NoDoubleClickListener() {
            @Override
            public void onNoDoubleClick(View v) {
                Intent intent = new Intent(context, ArrayUtilsActivity.class);
                startActivity(intent);
            }
        });
    }

    @Override
    protected int getContentView() {
        return R.layout.activity_main;
    }
}
